
require('./common');


exports.load = function(req, res){
	
	var id = req.params.id;
	var fieldName;
	var fieldValue;
	
	if(id=="0"){
		var strSQL = "SELECT * FROM tblworkspace WHERE FormName <> '' ORDER BY Name ";
	}else{
		var strSQL = "SELECT * FROM tblworkspace WHERE ID=" + conn.escape(id) +" AND FormName <> '' ORDER BY Name ";
	}
	
	conn.query(strSQL, function(err, results, fields){
		if(err) throw err;
			res.send(results);
	});

}

